import cv2 as cv
import numpy as np
img = cv.imread('../../data/messi5.jpg')
#params calculation
scaleUp,scaleDown=1.2,0.5
scaleUWidth=round(img.shape[1]*scaleUp)
scaleUHeight =round(img.shape[0]*scaleUp)
scaleDWidth=round(img.shape[1]*scaleDown)
scaleDHeight=round(img.shape[0]*scaleDown)
#method 1:cv.resize
imgScaledU=cv.resize(img,(scaleUWidth,scaleUHeight),interpolation=cv.INTER_CUBIC)
imgScaledU =imgScaledD=cv.resize(img,(scaleDWidth,scaleDHeight),interpolation=cv.INTER_AREA)
print(img.shape,imgScaledU.shape,imgScaledD.shape)
cv.imshow("org",img)
cv.imshow("scaledu",imgScaledU)
cv.imshow("scaledD",imgScaledD)
cv.waitKey(0)
cv.destroyAllWindows()